# main.py
import flet as ft
from utils.router import Router


def main(page: ft.Page):
    # 基础配置
    page.title = "生鲜商城"
    page.vertical_alignment = ft.MainAxisAlignment.CENTER
    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER

    # 初始化路由
    router = Router(page)
    page.on_route_change = router.route_change
    page.on_view_pop = router.view_pop
    # 初始路由加载
    page.go(page.route)  # 修改: 设置默认路由为首页


ft.app(target=main)
